<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?><!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>我的电商系统</title>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/css/bootstrap-theme.min.css">
	<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>public/css/fornt.css">
</head>
<body id="lists">
<?php $this->load->view('header');?>
<br />
<div class="container">
	<div class="row">
		<div class="col-md-3 main_lists">
			<ul class="list-group">
				<li  id="lists_catalog"><a href=""><i class="glyphicon glyphicon-th-list"></i><?php echo $parent_catalog->name?></a></li>
				<?php foreach($child_catalogs as $c){?>
				<li  id="lists_child"><a <?php if($c->id==$catalog->id){?> class="active" <?php }?> href="<?php echo site_url('Product/lists/').$c->id?>"><?php echo $c->name;?></a></li>
				<?php }?>
			</ul>
		</div>
		<div class="col-md-9 lists_right">
			<table cellpadding="0" cellspacing="0" class="lists_table">
				<tr>
					<td class="pic">品牌</td>
					<td class="pic_detail">佳能 尼康 索尼</td>
				</tr>
				<tr>
					<td class="pic">单反级别</td>
					<td class="pic_detail">入门级 中级 高级</td>
				</tr>
				<tr>
					<td class="pic">屏幕尺寸</td>
					<td class="pic_detail">3英寸 3.2英寸</td>
				</tr>
				<tr>
					<td class="pic">价格</td>
					<td class="pic_detail">1360以下元 1360-2720元 2720-4080元 6800以上元</td>
				</tr>
			</table>
			<br />
			<div class="option"><a hred="#" class="option_bg">默认</a><a hred="#" class="">销量</a><a hred="#" class="">价格</a><a hred="#" class="">评论</a><a hred="#" class="">新品</a></div>
			<div class="row">
				<div class="col-md-12">
					<?php foreach($brands as $b){?>
						<a href="<?php echo current_url().'?brand='.$b->id;?>"><?php echo $b->name;?></a>
					<?php }?>
				</div>
			</div>
			<div class="row">
			<?php foreach($products_imgs as $p){?>
				<div class="col-md-3 products_lists clearfix">
					<img class="main_img" src="<?php echo base_url().$p->img?>"  />
					<?php $imgs=$this->Product_img_model->get_child_id_img($p->id) ?>
					<ul class="products_lists_detail clearfix">
					<?php foreach($imgs as $img){?>
						<li class=""><img src="<?php echo base_url().$img->url?>" /></li>
					<?php }?>
					</ul>
					<p class="price"> ￥<?php echo $p->price; ?></p>
					<p class="title"><a href="<?php echo site_url('/Product/detail/').$p->id;?>"><?php echo $p->title; ?></a></p>
					<a class="btn btn-danger add_shopcart">加入购物车</a>
				</div>
			<?php }?>
			</div>
		</div>
	</div>	
</div>
</body>
	<script type="text/javascript" src="<?php echo base_url();?>public/js/jquery.js"></script>
	<script type="text/javascript" src="<?php echo base_url();?>public/js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(function(){
			$('.option a').click(function(){
				$('.option a').removeClass('option_bg');
				$(this).addClass('option_bg');
			})
			$('.products_lists_detail li').mouseover(function(){
	    		$(this).parents('.products_lists').find('ul li').removeClass('hover');
	    		$(this).addClass('hover');
	    		var src=$(this).find('img').attr('src');
	    		$(this).parents('.products_lists').find('.main_img').attr('src',src);
	    	});
		})
	</script>
</html>